{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Using Interact"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `interact` function (`ipywidgets.interact`) automatically creates user interface (UI) controls for exploring code and data interactively. It is the easiest way to get started using IPython's widgets."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from __future__ import print_function\n",
    "from ipywidgets import interact, interactive, fixed, interact_manual\n",
    "import ipywidgets as widgets"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Basic `interact`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "At the most basic level, `interact` autogenerates UI controls for function arguments, and then calls the function with those arguments when you manipulate the controls interactively. To use `interact`, you need to define a function that you want to explore. Here is a function that prints its only argument `x`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def f(x):\n",
    "    return x"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When you pass this function as the first argument to `interact` along with an integer keyword argument (`x=10`), a slider is generated and bound to the function parameter."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f033f0e3edcf43ccb1a2acd6d425f76b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(IntSlider(value=10, description='x', max=30, min=-10), Output()), _dom_classes=('widget-…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(f, x=10);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When you move the slider, the function is called, which prints the current value of `x`.\n",
    "\n",
    "If you pass `True` or `False`, `interact` will generate a checkbox:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "15163972fb56426aa3ae2c77f72d0242",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(Checkbox(value=True, description='x'), Output()), _dom_classes=('widget-interact',))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(f, x=True);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If you pass a string, `interact` will generate a text area."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "222e7059bc3b42e7ad87230fcdf76ad7",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(Text(value='Hi there!', description='x'), Output()), _dom_classes=('widget-interact',))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(f, x='Hi there!');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`interact` can also be used as a decorator. This allows you to define a function and interact with it in a single shot. As this example shows, `interact` also works with functions that have multiple arguments."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "55fb76f8e64f42bc9bc2a4340644955c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(Checkbox(value=True, description='x'), FloatSlider(value=1.0, description='y', max=3.0, …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "@interact(x=True, y=1.0)\n",
    "def g(x, y):\n",
    "    return (x, y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Fixing arguments using `fixed`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are times when you may want to explore a function using `interact`, but fix one or more of its arguments to specific values. This can be accomplished by wrapping values with the `fixed` function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def h(p, q):\n",
    "    return (p, q)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When we call `interact`, we pass `fixed(20)` for q to hold it fixed at a value of `20`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "9ff68d35b29643b3bfb83d9b87296b44",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(IntSlider(value=5, description='p', max=15, min=-5), Output()), _dom_classes=('widget-in…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(h, p=5, q=fixed(20));"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice that a slider is only produced for `p` as the value of `q` is fixed."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Widget abbreviations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When you pass an integer-valued keyword argument of `10` (`x=10`) to `interact`, it generates an integer-valued slider control with a range of `[-10,+3*10]`. In this case, `10` is an *abbreviation* for an actual slider widget:\n",
    "\n",
    "```python\n",
    "IntSlider(min=-10,max=30,step=1,value=10)\n",
    "```\n",
    "\n",
    "In fact, we can get the same result if we pass this `IntSlider` as the keyword argument for `x`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "223ad088ced145819dd25d13e14f4e00",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(IntSlider(value=10, description='x', max=30, min=-10), Output()), _dom_classes=('widget-…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(f, x=widgets.IntSlider(min=-10,max=30,step=1,value=10));"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This examples clarifies how `interact` processes its keyword arguments:\n",
    "\n",
    "1. If the keyword argument is a `Widget` instance with a `value` attribute, that widget is used. Any widget with a `value` attribute can be used, even custom ones.\n",
    "2. Otherwise, the value is treated as a *widget abbreviation* that is converted to a widget before it is used.\n",
    "\n",
    "The following table gives an overview of different widget abbreviations:\n",
    "\n",
    "<table class=\"table table-condensed table-bordered\">\n",
    "  <tr><td><strong>Keyword argument</strong></td><td><strong>Widget</strong></td></tr>  \n",
    "  <tr><td>`True` or `False`</td><td>Checkbox</td></tr>  \n",
    "  <tr><td>`'Hi there'`</td><td>Text</td></tr>\n",
    "  <tr><td>`value` or `(min,max)` or `(min,max,step)` if integers are passed</td><td>IntSlider</td></tr>\n",
    "  <tr><td>`value` or `(min,max)` or `(min,max,step)` if floats are passed</td><td>FloatSlider</td></tr>\n",
    "  <tr><td>`['orange','apple']` or `{'one':1,'two':2}`</td><td>Dropdown</td></tr>\n",
    "</table>\n",
    "Note that a dropdown is used if a list or a dict is given (signifying discrete choices), and a slider is used if a tuple is given (signifying a range)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You have seen how the checkbox and textarea widgets work above. Here, more details about the different abbreviations for sliders and dropdowns are given.\n",
    "\n",
    "If a 2-tuple of integers is passed `(min,max)`, an integer-valued slider is produced with those minimum and maximum values (inclusively). In this case, the default step size of `1` is used."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1ed79e95f9d344b8b6474a0049d49ab1",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(IntSlider(value=2, description='x', max=4), Output()), _dom_classes=('widget-interact',)…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(f, x=(0,4));"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If a 3-tuple of integers is passed `(min,max,step)`, the step size can also be set."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "00c6df02e73342ca8f2183ea15025d52",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(IntSlider(value=4, description='x', max=8, step=2), Output()), _dom_classes=('widget-int…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(f, x=(0,8,2));"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A float-valued slider is produced if the elements of the tuples are floats. Here the minimum is `0.0`, the maximum is `10.0` and step size is `0.1` (the default)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "bd0e5dc04aa345bd85d34f192d278031",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(FloatSlider(value=5.0, description='x', max=10.0), Output()), _dom_classes=('widget-inte…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(f, x=(0.0,10.0));"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The step size can be changed by passing a third element in the tuple."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "482ed7eb581c42c296a6a45c41e5ed24",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(FloatSlider(value=5.0, description='x', max=10.0, step=0.01), Output()), _dom_classes=('…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(f, x=(0.0,10.0,0.01));"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For both integer and float-valued sliders, you can pick the initial value of the widget by passing a default keyword argument to the underlying Python function. Here we set the initial value of a float slider to `5.5`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "6401a9e7e52f46868e5a042861d48f27",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(FloatSlider(value=5.5, description='x', max=20.0, step=0.5), Output()), _dom_classes=('w…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "@interact(x=(0.0,20.0,0.5))\n",
    "def h(x=5.5):\n",
    "    return x"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Dropdown menus are constructed by passing a list of strings. In this case, the strings are both used as the names in the dropdown menu UI and passed to the underlying Python function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f4360071d1004580bf5408bf785e1c9d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(Dropdown(description='x', options=('apples', 'oranges'), value='apples'), Output()), _do…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(f, x=['apples','oranges']);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If you want a dropdown menu that passes non-string values to the Python function, you can pass a list of (label, value) pairs."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "93d5b89bdbac438f8fd1dfffa3b2fad2",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(Dropdown(description='x', options=(('one', 10), ('two', 20)), value=10), Output()), _dom…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(f, x=[('one', 10), ('two', 20)]);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## `interactive`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In addition to `interact`, IPython provides another function, `interactive`, that is useful when you want to reuse the widgets that are produced or access the data that is bound to the UI controls.\n",
    "\n",
    "Note that unlike `interact`, the return value of the function will not be displayed automatically, but you can display a value inside the function with `IPython.display.display`."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here is a function that returns the sum of its two arguments and displays them. The display line may be omitted if you don't want to show the result of the function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "from IPython.display import display\n",
    "def f(a, b):\n",
    "    display(a + b)\n",
    "    return a+b"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Unlike `interact`, `interactive` returns a `Widget` instance rather than immediately displaying the widget."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "w = interactive(f, a=10, b=20)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The widget is an `interactive`, a subclass of `VBox`, which is a container for other widgets."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "ipywidgets.widgets.interaction.interactive"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(w)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The children of the `interactive` are two integer-valued sliders and an output widget, produced by the widget abbreviations above."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(IntSlider(value=10, description='a', max=30, min=-10),\n",
       " IntSlider(value=20, description='b', max=60, min=-20),\n",
       " Output())"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "w.children"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To actually display the widgets, you can use IPython's `display` function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "05b0702daf424ad789fe8d9d6e83336a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(IntSlider(value=10, description='a', max=30, min=-10), IntSlider(value=20, description='…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "display(w)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "At this point, the UI controls work just like they would if `interact` had been used. You can manipulate them interactively and the function will be called. However, the widget instance returned by `interactive` also gives you access to the current keyword arguments and return value of the underlying Python function. \n",
    "\n",
    "Here are the current keyword arguments. If you rerun this cell after manipulating the sliders, the values will have changed."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'a': 10, 'b': 20}"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "w.kwargs"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here is the current return value of the function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "30"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "w.result"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Disabling continuous updates"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When interacting with long running functions, realtime feedback is a burden instead of being helpful.  See the following example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "def slow_function(i):\n",
    "    print(int(i),list(x for x in range(int(i)) if \n",
    "                str(x)==str(x)[::-1] and \n",
    "                str(x**2)==str(x**2)[::-1]))\n",
    "    return"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1000000 [0, 1, 2, 3, 11, 22, 101, 111, 121, 202, 212, 1001, 1111, 2002, 10001, 10101, 10201, 11011, 11111, 11211, 20002, 20102, 100001, 101101, 110011, 111111, 200002]\n",
      "CPU times: user 578 ms, sys: 5.41 ms, total: 583 ms\n",
      "Wall time: 586 ms\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "slow_function(1e6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice that the output is updated even while dragging the mouse on the slider. This is not useful for long running functions due to lagging:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d829e71d520f45c2babd61343c8c3403",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(FloatSlider(value=100000.0, description='i', max=10000000.0, min=100000.0, step=100000.0…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from ipywidgets import FloatSlider\n",
    "interact(slow_function,i=FloatSlider(min=1e5, max=1e7, step=1e5));"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are two ways to mitigate this.  You can either only execute on demand, or restrict execution to mouse release events."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### `interact_manual`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The `interact_manual` function provides a variant of interaction that allows you to restrict execution so it is only done on demand.  A button is added to the interact controls that allows you to trigger an execute event."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "2825044603bc4ca88b4e31fad6323de1",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(FloatSlider(value=100000.0, description='i', max=10000000.0, min=100000.0, step=100000.0…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact_manual(slow_function,i=FloatSlider(min=1e5, max=1e7, step=1e5));"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### `continuous_update`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If you are using slider widgets, you can set the `continuous_update` kwarg to `False`.  `continuous_update` is a kwarg of slider widgets that restricts executions to mouse release events."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "6ab91396cf5b48c18091a483ab74becb",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(FloatSlider(value=100000.0, continuous_update=False, description='i', max=10000000.0, mi…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "interact(slow_function,i=FloatSlider(min=1e5, max=1e7, step=1e5, continuous_update=False));"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### `interactive_output`\n",
    "\n",
    "`interactive_output` provides additional flexibility: you can control how the UI elements are laid out.\n",
    "\n",
    "Unlike `interact`, `interactive`, and `interact_manual`, `interactive_output` does not generate a user interface for the widgets. This is powerful, because it means you can create a widget, put it in a box, and then pass the widget to `interactive_output`, and have control over the widget and its layout."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "cd9df478fc9745bda1a3e291e467fa73",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "HBox(children=(IntSlider(value=0), IntSlider(value=0), IntSlider(value=0)))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "37204ea492d94bb5a437b781194d4af0",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "a = widgets.IntSlider()\n",
    "b = widgets.IntSlider()\n",
    "c = widgets.IntSlider()\n",
    "ui = widgets.HBox([a, b, c])\n",
    "def f(a, b, c):\n",
    "    print((a, b, c))\n",
    "\n",
    "out = widgets.interactive_output(f, {'a': a, 'b': b, 'c': c})\n",
    "\n",
    "display(ui, out)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Arguments that are dependent on each other"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Arguments that are dependent on each other can be expressed manually using `observe`.  See the following example, where one variable is used to describe the bounds of another.  For more information, please see the [widget events example notebook](./Widget Events.ipynb)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "0786b892519440d09487064cb11d907f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(FloatSlider(value=0.0, description='x', max=10.0, step=0.05), FloatSlider(value=5.0, des…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "x_widget = FloatSlider(min=0.0, max=10.0, step=0.05)\n",
    "y_widget = FloatSlider(min=0.5, max=10.0, step=0.05, value=5.0)\n",
    "\n",
    "def update_x_range(*args):\n",
    "    x_widget.max = 2.0 * y_widget.value\n",
    "y_widget.observe(update_x_range, 'value')\n",
    "\n",
    "def printer(x, y):\n",
    "    print(x, y)\n",
    "interact(printer,x=x_widget, y=y_widget);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Flickering and jumping output\n",
    "\n",
    "On occasion, you may notice interact output flickering and jumping, causing the notebook scroll position to change as the output is updated. The interactive control has a layout, so we can set its height to an appropriate value (currently chosen manually) so that it will not change size as it is updated.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d2074ce69c7949b6a33b7ac5f333bc8b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(FloatSlider(value=0.0, description='m', max=2.0, min=-2.0), FloatSlider(value=0.0, descr…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "from ipywidgets import interactive\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
    "def f(m, b):\n",
    "    plt.figure(2)\n",
    "    x = np.linspace(-10, 10, num=1000)\n",
    "    plt.plot(x, m * x + b)\n",
    "    plt.ylim(-5, 5)\n",
    "    plt.show()\n",
    "\n",
    "interactive_plot = interactive(f, m=(-2.0, 2.0), b=(-3, 3, 0.5))\n",
    "output = interactive_plot.children[-1]\n",
    "output.layout.height = '350px'\n",
    "interactive_plot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {
     "00c6df02e73342ca8f2183ea15025d52": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_5c990ddbb95046389664cec7035382ae",
        "IPY_MODEL_9bcfe85dc67940ba8a33fb3b7738f0f4"
       ],
       "layout": "IPY_MODEL_d38ecb1814784d69a206c6dbf149a91a"
      }
     },
     "01bf1a39bf26433a9734c0d0a3fb1ea7": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "027fdc4bd5074e66adfbb6732874ef49": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "FloatSliderModel",
      "state": {
       "description": "m",
       "layout": "IPY_MODEL_7d522b95d9f5405c970cd20c796cade2",
       "max": 2,
       "min": -2,
       "step": 0.1,
       "style": "IPY_MODEL_76066491075142a5a5374c5c3861aed4"
      }
     },
     "0594a48a01524ecfb03b75430870ff01": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "05b0702daf424ad789fe8d9d6e83336a": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_087925f1efc04e72ac42e1d74d0b46ff",
        "IPY_MODEL_d81e4389c79d4208bf378ae04d2e688b",
        "IPY_MODEL_bb2355a3b29846418b505e3251267762"
       ],
       "layout": "IPY_MODEL_a7161c5f033d43a9b0c74045f911075f"
      }
     },
     "05ffb5b9ba8042e8b0aae2e8db329a65": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "075b550d7071452080eef4557538b33a": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "TextModel",
      "state": {
       "description": "x",
       "layout": "IPY_MODEL_a6e5164f75ee4be2abe454ee41afe4b8",
       "style": "IPY_MODEL_5e5636faeb0145fa9528712f44b39e8b",
       "value": "Hi there!"
      }
     },
     "0786b892519440d09487064cb11d907f": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_d708c16ad4e645a5bedad7c85a666544",
        "IPY_MODEL_fd767d0532654a2abbbf19cb575bf0a9",
        "IPY_MODEL_3fdfc934d2224cd581a8360a7518d8b6"
       ],
       "layout": "IPY_MODEL_f5f267b9582e4bdbb80f5e5313b94e8f"
      }
     },
     "087925f1efc04e72ac42e1d74d0b46ff": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "IntSliderModel",
      "state": {
       "description": "a",
       "layout": "IPY_MODEL_e10eb4630aee47699d6870f9d69653b6",
       "max": 30,
       "min": -10,
       "style": "IPY_MODEL_be62be2500db4f7199ff51d0c98925b4",
       "value": 10
      }
     },
     "0915bed033034002ac2481442b52dfc2": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "0958092831da4984b8ea57cec45d84c0": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "095ee59539354749ab8e28dd9c18cf9a": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "09ad3046bcec4f739c1aec28f8bb8596": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "0cb23651e77d410eb17b687f8cb8c865": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "0eafa181aecd4b9bba70484857aef6dd": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_4e71ebc08b2f4f1d94344830ec314ff9",
       "outputs": [
        {
         "data": {
          "text/plain": "(True, 1.0)"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "1071d6ed008d4d31b50eb45324e3268a": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "ButtonStyleModel",
      "state": {}
     },
     "10e9bcf4b16e4f6b8c5d81cabaeeee55": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_db7d7fab789b40faa0f44d9d489ebda1",
       "outputs": [
        {
         "data": {
          "text/plain": "5.0"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "124088a0e8eb49768f3a1ee5e2b6b5e7": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_d1841751618b4f64a5d8aff7437d9146",
       "outputs": [
        {
         "data": {
          "text/plain": "'Hi there!'"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "12574ead8f1e4246861ef090c5a3cc64": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "FloatSliderModel",
      "state": {
       "description": "x",
       "layout": "IPY_MODEL_9cdd3bd3158c4249ad1a08090297ac19",
       "max": 20,
       "step": 0.5,
       "style": "IPY_MODEL_2c63cad5cb7541e2b8fcecb7317587b1",
       "value": 5.5
      }
     },
     "15163972fb56426aa3ae2c77f72d0242": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_e47d8ed3d8b64c33b7be6d6fbb5c8043",
        "IPY_MODEL_efa6dff08d4042cfa4cad4ea2cd9b0d3"
       ],
       "layout": "IPY_MODEL_f0c2430c49964174b2b98c396ab47f8e"
      }
     },
     "1561ec3b83544f6da52b54b81e03424b": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "16cdb235cc554822b97329b63e94d4d5": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "DropdownModel",
      "state": {
       "_options_labels": [
        "one",
        "two"
       ],
       "description": "x",
       "index": 0,
       "layout": "IPY_MODEL_331fa54206594f1481f3193dd3e56767",
       "style": "IPY_MODEL_f558da4bd74747df81d36c9a44e28df3"
      }
     },
     "18cbb06d65eb4a16908365899cb0aba3": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "19a38ad4e60f4e7ca1290008f58ebd40": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "1c4e17ab4e1c427cb043fcdba1f29ed2": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "1d0fc2407f4c423c92d0f341cb067f40": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "1ed79e95f9d344b8b6474a0049d49ab1": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_a8c5697bdc98492994605224daf22010",
        "IPY_MODEL_758d3373c7a2426dbf14648ce970fbab"
       ],
       "layout": "IPY_MODEL_8a86b279718b47e5bad34a004e806b9b"
      }
     },
     "222e7059bc3b42e7ad87230fcdf76ad7": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_075b550d7071452080eef4557538b33a",
        "IPY_MODEL_124088a0e8eb49768f3a1ee5e2b6b5e7"
       ],
       "layout": "IPY_MODEL_bbd17a2eb5cb42dca9a9722623351b98"
      }
     },
     "223ad088ced145819dd25d13e14f4e00": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_f8d77c653f4f4719b1071872033e862a",
        "IPY_MODEL_afbdafa5ee9044158749a7434202dec5"
       ],
       "layout": "IPY_MODEL_a89852a28fe84286b257911d1c2e997f"
      }
     },
     "24b23d4021b944a7a66d653aa197c6e0": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "25382077986c42c68b02a22931922636": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "2709f5bc99e44625976cab25175f3c2c": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "2825044603bc4ca88b4e31fad6323de1": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_2c1fcf1b2837474190e7f56c93ceac80",
        "IPY_MODEL_f66e2484398441d29868e1b00d491c5d",
        "IPY_MODEL_7636ebc78f1247b8bc797daa8679eb98"
       ],
       "layout": "IPY_MODEL_4178fb9cbcfe48c78c373c9a13793021"
      }
     },
     "2c1fcf1b2837474190e7f56c93ceac80": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "FloatSliderModel",
      "state": {
       "description": "i",
       "layout": "IPY_MODEL_2709f5bc99e44625976cab25175f3c2c",
       "max": 10000000,
       "min": 100000,
       "step": 100000,
       "style": "IPY_MODEL_663c0ff472394a05b9c5becc4abcd761",
       "value": 100000
      }
     },
     "2c63cad5cb7541e2b8fcecb7317587b1": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "30679fd7912545b4a192d91923c76831": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "331fa54206594f1481f3193dd3e56767": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "34e9eca67d87423a8019bb5e7cddea7f": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "FloatSliderModel",
      "state": {
       "description": "y",
       "layout": "IPY_MODEL_afc0cae1f84640fdaeb2123fb2d15fb5",
       "max": 3,
       "min": -1,
       "step": 0.1,
       "style": "IPY_MODEL_cfbe54fefdb44343a95023cfa476dac9",
       "value": 1
      }
     },
     "37204ea492d94bb5a437b781194d4af0": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_f7aa92f05c1b4b85b0ac310426f58d7c",
       "outputs": [
        {
         "name": "stdout",
         "output_type": "stream",
         "text": "(0, 0, 0)\n"
        }
       ]
      }
     },
     "39ed90ded9044c25a02236de2b3a5037": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "3bc54f2937d143a5ab3e3f507a6ad73f": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "3c3b6f95c8ff431981adbd153763c180": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "CheckboxModel",
      "state": {
       "description": "x",
       "disabled": false,
       "layout": "IPY_MODEL_5c4fe49015e34e8d9c834639ef3a1cfb",
       "style": "IPY_MODEL_0cb23651e77d410eb17b687f8cb8c865",
       "value": true
      }
     },
     "3d464c0255e343eaad35ed5675bc1fe0": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "3fdfc934d2224cd581a8360a7518d8b6": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_c295641d02b248809e00419c126c8da1",
       "outputs": [
        {
         "name": "stdout",
         "output_type": "stream",
         "text": "0.0 5.0\n"
        }
       ]
      }
     },
     "4046bb590921472cad4270ec31b603ed": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_f13e3a632d434d6d9c213c394081e6a8",
       "outputs": [
        {
         "data": {
          "text/plain": "5.0"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "40ea12aed26a4ddf9b396783ac1f3633": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "41293c7f1fc24d7f84c5f39c829f5645": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_05ffb5b9ba8042e8b0aae2e8db329a65",
       "outputs": [
        {
         "name": "stdout",
         "output_type": "stream",
         "text": "100000 [0, 1, 2, 3, 11, 22, 101, 111, 121, 202, 212, 1001, 1111, 2002, 10001, 10101, 10201, 11011, 11111, 11211, 20002, 20102]\n"
        }
       ]
      }
     },
     "4178fb9cbcfe48c78c373c9a13793021": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "482ed7eb581c42c296a6a45c41e5ed24": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_958d785b53ff44fc98ada61785387748",
        "IPY_MODEL_4046bb590921472cad4270ec31b603ed"
       ],
       "layout": "IPY_MODEL_cb02d590e2a24a339ce5b4bc6bbf03ef"
      }
     },
     "4c52785e0a6346579b52fbdc7d900e2f": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "4e71ebc08b2f4f1d94344830ec314ff9": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "50bf5db6aa694760b3d2ac80d03ac4bb": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_80ce329e08794806b56a112e7a6d2e9b",
       "outputs": [
        {
         "data": {
          "image/png": "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\n",
          "text/plain": "<Figure size 432x288 with 1 Axes>"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "525209fdbe0a4b86b145ff2c3ba991cd": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "55fb76f8e64f42bc9bc2a4340644955c": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_3c3b6f95c8ff431981adbd153763c180",
        "IPY_MODEL_34e9eca67d87423a8019bb5e7cddea7f",
        "IPY_MODEL_0eafa181aecd4b9bba70484857aef6dd"
       ],
       "layout": "IPY_MODEL_d4c26ee816c04fcbb3e3369a47670386"
      }
     },
     "5a4b3d367a3e44ee923d3eefcad4d578": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "5b8dc227a94a42d09651a0531ea6818a": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "5c4fe49015e34e8d9c834639ef3a1cfb": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "5c990ddbb95046389664cec7035382ae": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "IntSliderModel",
      "state": {
       "description": "x",
       "layout": "IPY_MODEL_7914ff4848834b62b7ff3d1228483323",
       "max": 8,
       "step": 2,
       "style": "IPY_MODEL_8529cd039b0c4a9199879e2cb87f918a",
       "value": 4
      }
     },
     "5df256ac024a47cabfeccc867a788523": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "5e5636faeb0145fa9528712f44b39e8b": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "613f1639b6a5475ab2c9f690f592c673": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "6401a9e7e52f46868e5a042861d48f27": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_12574ead8f1e4246861ef090c5a3cc64",
        "IPY_MODEL_d24e5412fe314b0bbcae4b1b1b13a37d"
       ],
       "layout": "IPY_MODEL_dc5e6dbaaa0a4a3380c8140720430d2e"
      }
     },
     "640e6be17c28412e843a168b0aa558b6": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "663c0ff472394a05b9c5becc4abcd761": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "6ab91396cf5b48c18091a483ab74becb": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_f8f53a5d93ea4866a46b0ff106fca80c",
        "IPY_MODEL_41293c7f1fc24d7f84c5f39c829f5645"
       ],
       "layout": "IPY_MODEL_39ed90ded9044c25a02236de2b3a5037"
      }
     },
     "6c709a42ad54487c86967820d027da2a": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "758d3373c7a2426dbf14648ce970fbab": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_c03ec0712e674c5c918861c668b25d14",
       "outputs": [
        {
         "data": {
          "text/plain": "2"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "76066491075142a5a5374c5c3861aed4": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "7606fe77ccab4bc6afd865978bc7e5be": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_1561ec3b83544f6da52b54b81e03424b",
       "outputs": [
        {
         "data": {
          "text/plain": "'apples'"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "7636ebc78f1247b8bc797daa8679eb98": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_7a5251fb0bc249daac117d2c1528dedb"
      }
     },
     "7914ff4848834b62b7ff3d1228483323": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "7a5251fb0bc249daac117d2c1528dedb": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "7b9939a164ec4fd696a024e553a24273": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_3d464c0255e343eaad35ed5675bc1fe0",
       "outputs": [
        {
         "data": {
          "text/plain": "10"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "7d522b95d9f5405c970cd20c796cade2": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "7d9f82e664c143e0b45a9df5ed8ce416": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "80ce329e08794806b56a112e7a6d2e9b": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {
       "height": "350px"
      }
     },
     "80da7e7f1c144043bcf5fcc60af65e77": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "8529cd039b0c4a9199879e2cb87f918a": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "8600e512e6064e3189d44e5e4194e44f": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "87c33f3da654486387892ab6bb7409f6": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "8a0d71b4b8594ad18d4cd6e4fa3d3ff8": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "FloatSliderModel",
      "state": {
       "description": "x",
       "layout": "IPY_MODEL_5b8dc227a94a42d09651a0531ea6818a",
       "max": 10,
       "step": 0.1,
       "style": "IPY_MODEL_6c709a42ad54487c86967820d027da2a",
       "value": 5
      }
     },
     "8a86b279718b47e5bad34a004e806b9b": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "8ed5704fb133455a820148311537430a": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "9204c17374944ccb81ed6edd080f62a8": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "FloatSliderModel",
      "state": {
       "description": "i",
       "layout": "IPY_MODEL_957eb9f559574281a4939e760931dcb7",
       "max": 10000000,
       "min": 100000,
       "step": 100000,
       "style": "IPY_MODEL_8600e512e6064e3189d44e5e4194e44f",
       "value": 100000
      }
     },
     "934beb95bef145d6b97c248dc615544d": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "93d5b89bdbac438f8fd1dfffa3b2fad2": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_16cdb235cc554822b97329b63e94d4d5",
        "IPY_MODEL_98f347e7f6fd49b78035d2292d1e804b"
       ],
       "layout": "IPY_MODEL_c34a38797d774dd8874442fede13873a"
      }
     },
     "93e45d43537d4b9aae925b665bcf7a5b": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "950683eaca0e4eb0bf5d8dc3c1413435": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "957eb9f559574281a4939e760931dcb7": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "958d785b53ff44fc98ada61785387748": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "FloatSliderModel",
      "state": {
       "description": "x",
       "layout": "IPY_MODEL_3bc54f2937d143a5ab3e3f507a6ad73f",
       "max": 10,
       "step": 0.01,
       "style": "IPY_MODEL_e6e3abd3ef084d7e8a86f101db541446",
       "value": 5
      }
     },
     "95e8d18ca86d408a99f6fbc95a96edfe": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "983cd3aa2dae439b9a2c451b63cfa372": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "98f347e7f6fd49b78035d2292d1e804b": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_ecb567d1db1c4676a924ebbb2de0d6c8",
       "outputs": [
        {
         "data": {
          "text/plain": "10"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "9bcfe85dc67940ba8a33fb3b7738f0f4": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_40ea12aed26a4ddf9b396783ac1f3633",
       "outputs": [
        {
         "data": {
          "text/plain": "4"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "9cdd3bd3158c4249ad1a08090297ac19": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "9ff68d35b29643b3bfb83d9b87296b44": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_f60a4790a75d47b1ba6c6a675ea2e36b",
        "IPY_MODEL_bfe48e65e4bb48e3a8774a5acb40abae"
       ],
       "layout": "IPY_MODEL_c6f7d10328ce40e6a72f754da78e9734"
      }
     },
     "a267f58ff8324debabccb0279bf2a287": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "a6e5164f75ee4be2abe454ee41afe4b8": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "a7161c5f033d43a9b0c74045f911075f": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "a89852a28fe84286b257911d1c2e997f": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "a8c5697bdc98492994605224daf22010": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "IntSliderModel",
      "state": {
       "description": "x",
       "layout": "IPY_MODEL_5a4b3d367a3e44ee923d3eefcad4d578",
       "max": 4,
       "style": "IPY_MODEL_93e45d43537d4b9aae925b665bcf7a5b",
       "value": 2
      }
     },
     "adb6797e127b47e29a348f69e2387165": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "afbdafa5ee9044158749a7434202dec5": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_1d0fc2407f4c423c92d0f341cb067f40",
       "outputs": [
        {
         "data": {
          "text/plain": "10"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "afc0cae1f84640fdaeb2123fb2d15fb5": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "b1f9e0d181bf46d8baea0a962bedaf6a": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "bab43214a622472ea72d93065f73d2d2": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "DropdownModel",
      "state": {
       "_options_labels": [
        "apples",
        "oranges"
       ],
       "description": "x",
       "index": 0,
       "layout": "IPY_MODEL_f1688f748fe44bc3956d8b4c6da2989a",
       "style": "IPY_MODEL_5df256ac024a47cabfeccc867a788523"
      }
     },
     "bb2355a3b29846418b505e3251267762": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_8ed5704fb133455a820148311537430a",
       "outputs": [
        {
         "data": {
          "text/plain": "30"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "bbd17a2eb5cb42dca9a9722623351b98": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "bd0e5dc04aa345bd85d34f192d278031": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_8a0d71b4b8594ad18d4cd6e4fa3d3ff8",
        "IPY_MODEL_10e9bcf4b16e4f6b8c5d81cabaeeee55"
       ],
       "layout": "IPY_MODEL_613f1639b6a5475ab2c9f690f592c673"
      }
     },
     "bd889a0f1bd74b859f8940863b54fe9e": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "be62be2500db4f7199ff51d0c98925b4": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "bfe48e65e4bb48e3a8774a5acb40abae": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_30679fd7912545b4a192d91923c76831",
       "outputs": [
        {
         "data": {
          "text/plain": "(5, 20)"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "c03ec0712e674c5c918861c668b25d14": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "c295641d02b248809e00419c126c8da1": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "c34a38797d774dd8874442fede13873a": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "c6f7d10328ce40e6a72f754da78e9734": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "c806bd5b0c3041c0b38f59cf53b42144": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_da142600dede46f7bc26976165f42142",
       "outputs": [
        {
         "name": "stdout",
         "output_type": "stream",
         "text": "100000 [0, 1, 2, 3, 11, 22, 101, 111, 121, 202, 212, 1001, 1111, 2002, 10001, 10101, 10201, 11011, 11111, 11211, 20002, 20102]\n"
        }
       ]
      }
     },
     "ca32ae2961354694bfb56c867b485397": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "caeff6c6e28b4e6bb08a96ce112de9d4": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "cb02d590e2a24a339ce5b4bc6bbf03ef": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "cd9df478fc9745bda1a3e291e467fa73": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "HBoxModel",
      "state": {
       "children": [
        "IPY_MODEL_ffb3c03d22994d4eac5132b72351d57b",
        "IPY_MODEL_d18caf1f35394938b1e9d91994a047fa",
        "IPY_MODEL_e075b1152e294fd38d838c3a333cca6d"
       ],
       "layout": "IPY_MODEL_1c4e17ab4e1c427cb043fcdba1f29ed2"
      }
     },
     "cf5aaa2d5b0847b3864a940a8009c291": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "FloatSliderModel",
      "state": {
       "description": "b",
       "layout": "IPY_MODEL_e941a4ad85d8474a8872aaeebf14b684",
       "max": 3,
       "min": -3,
       "step": 0.5,
       "style": "IPY_MODEL_0594a48a01524ecfb03b75430870ff01"
      }
     },
     "cfbe54fefdb44343a95023cfa476dac9": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "d0d66c4182ad4fe687e3388819f8de3e": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "d1841751618b4f64a5d8aff7437d9146": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "d18caf1f35394938b1e9d91994a047fa": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "IntSliderModel",
      "state": {
       "layout": "IPY_MODEL_caeff6c6e28b4e6bb08a96ce112de9d4",
       "style": "IPY_MODEL_01bf1a39bf26433a9734c0d0a3fb1ea7"
      }
     },
     "d1b68543684b4119a2be3076732ca200": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "d2074ce69c7949b6a33b7ac5f333bc8b": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_027fdc4bd5074e66adfbb6732874ef49",
        "IPY_MODEL_cf5aaa2d5b0847b3864a940a8009c291",
        "IPY_MODEL_50bf5db6aa694760b3d2ac80d03ac4bb"
       ],
       "layout": "IPY_MODEL_0958092831da4984b8ea57cec45d84c0"
      }
     },
     "d24e5412fe314b0bbcae4b1b1b13a37d": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_24b23d4021b944a7a66d653aa197c6e0",
       "outputs": [
        {
         "data": {
          "text/plain": "5.5"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "d38ecb1814784d69a206c6dbf149a91a": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "d4c26ee816c04fcbb3e3369a47670386": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "d708c16ad4e645a5bedad7c85a666544": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "FloatSliderModel",
      "state": {
       "description": "x",
       "layout": "IPY_MODEL_950683eaca0e4eb0bf5d8dc3c1413435",
       "max": 10,
       "step": 0.05,
       "style": "IPY_MODEL_18cbb06d65eb4a16908365899cb0aba3"
      }
     },
     "d81e4389c79d4208bf378ae04d2e688b": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "IntSliderModel",
      "state": {
       "description": "b",
       "layout": "IPY_MODEL_095ee59539354749ab8e28dd9c18cf9a",
       "max": 60,
       "min": -20,
       "style": "IPY_MODEL_525209fdbe0a4b86b145ff2c3ba991cd",
       "value": 20
      }
     },
     "d829e71d520f45c2babd61343c8c3403": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_9204c17374944ccb81ed6edd080f62a8",
        "IPY_MODEL_c806bd5b0c3041c0b38f59cf53b42144"
       ],
       "layout": "IPY_MODEL_b1f9e0d181bf46d8baea0a962bedaf6a"
      }
     },
     "da142600dede46f7bc26976165f42142": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "db7d7fab789b40faa0f44d9d489ebda1": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "dc5e6dbaaa0a4a3380c8140720430d2e": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "de09bf16808749f7960dae91bd70a1a3": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "e075b1152e294fd38d838c3a333cca6d": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "IntSliderModel",
      "state": {
       "layout": "IPY_MODEL_87c33f3da654486387892ab6bb7409f6",
       "style": "IPY_MODEL_ca32ae2961354694bfb56c867b485397"
      }
     },
     "e10eb4630aee47699d6870f9d69653b6": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "e47d8ed3d8b64c33b7be6d6fbb5c8043": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "CheckboxModel",
      "state": {
       "description": "x",
       "disabled": false,
       "layout": "IPY_MODEL_983cd3aa2dae439b9a2c451b63cfa372",
       "style": "IPY_MODEL_7d9f82e664c143e0b45a9df5ed8ce416",
       "value": true
      }
     },
     "e6e3abd3ef084d7e8a86f101db541446": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "e941a4ad85d8474a8872aaeebf14b684": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "ecb567d1db1c4676a924ebbb2de0d6c8": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "efa6dff08d4042cfa4cad4ea2cd9b0d3": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_d1b68543684b4119a2be3076732ca200",
       "outputs": [
        {
         "data": {
          "text/plain": "True"
         },
         "metadata": {},
         "output_type": "display_data"
        }
       ]
      }
     },
     "f033f0e3edcf43ccb1a2acd6d425f76b": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_fc0ac8c971d84732aa5f5ea820588ec3",
        "IPY_MODEL_7b9939a164ec4fd696a024e553a24273"
       ],
       "layout": "IPY_MODEL_934beb95bef145d6b97c248dc615544d"
      }
     },
     "f0c2430c49964174b2b98c396ab47f8e": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "f13e3a632d434d6d9c213c394081e6a8": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "f1688f748fe44bc3956d8b4c6da2989a": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "f4360071d1004580bf5408bf785e1c9d": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "VBoxModel",
      "state": {
       "_dom_classes": [
        "widget-interact"
       ],
       "children": [
        "IPY_MODEL_bab43214a622472ea72d93065f73d2d2",
        "IPY_MODEL_7606fe77ccab4bc6afd865978bc7e5be"
       ],
       "layout": "IPY_MODEL_a267f58ff8324debabccb0279bf2a287"
      }
     },
     "f5296e817f674bd5bdaa5a7b8bd29ca9": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "SliderStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "f558da4bd74747df81d36c9a44e28df3": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "description_width": ""
      }
     },
     "f5f267b9582e4bdbb80f5e5313b94e8f": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "f60a4790a75d47b1ba6c6a675ea2e36b": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "IntSliderModel",
      "state": {
       "description": "p",
       "layout": "IPY_MODEL_25382077986c42c68b02a22931922636",
       "max": 15,
       "min": -5,
       "style": "IPY_MODEL_09ad3046bcec4f739c1aec28f8bb8596",
       "value": 5
      }
     },
     "f66e2484398441d29868e1b00d491c5d": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "ButtonModel",
      "state": {
       "description": "Run Interact",
       "layout": "IPY_MODEL_95e8d18ca86d408a99f6fbc95a96edfe",
       "style": "IPY_MODEL_1071d6ed008d4d31b50eb45324e3268a"
      }
     },
     "f7aa92f05c1b4b85b0ac310426f58d7c": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "f8d77c653f4f4719b1071872033e862a": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "IntSliderModel",
      "state": {
       "description": "x",
       "layout": "IPY_MODEL_0915bed033034002ac2481442b52dfc2",
       "max": 30,
       "min": -10,
       "style": "IPY_MODEL_bd889a0f1bd74b859f8940863b54fe9e",
       "value": 10
      }
     },
     "f8f53a5d93ea4866a46b0ff106fca80c": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "FloatSliderModel",
      "state": {
       "continuous_update": false,
       "description": "i",
       "layout": "IPY_MODEL_adb6797e127b47e29a348f69e2387165",
       "max": 10000000,
       "min": 100000,
       "step": 100000,
       "style": "IPY_MODEL_19a38ad4e60f4e7ca1290008f58ebd40",
       "value": 100000
      }
     },
     "fc0ac8c971d84732aa5f5ea820588ec3": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "IntSliderModel",
      "state": {
       "description": "x",
       "layout": "IPY_MODEL_de09bf16808749f7960dae91bd70a1a3",
       "max": 30,
       "min": -10,
       "style": "IPY_MODEL_640e6be17c28412e843a168b0aa558b6",
       "value": 10
      }
     },
     "fd767d0532654a2abbbf19cb575bf0a9": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "FloatSliderModel",
      "state": {
       "description": "y",
       "layout": "IPY_MODEL_4c52785e0a6346579b52fbdc7d900e2f",
       "max": 10,
       "min": 0.5,
       "step": 0.05,
       "style": "IPY_MODEL_d0d66c4182ad4fe687e3388819f8de3e",
       "value": 5
      }
     },
     "ffb3c03d22994d4eac5132b72351d57b": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.2.0",
      "model_name": "IntSliderModel",
      "state": {
       "layout": "IPY_MODEL_80da7e7f1c144043bcf5fcc60af65e77",
       "style": "IPY_MODEL_f5296e817f674bd5bdaa5a7b8bd29ca9"
      }
     }
    },
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
